# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=asciidoc
pkgver=9.1.1
pkgrel=0
pkgdesc="Text based documentation"
url="https://asciidoc.org/"
arch="noarch"
license="GPL-2.0-or-later and GPL-1.0-or-later"
depends="python3 libxml2-utils docbook-xsl source-highlight"
makedepends="autoconf automake"
subpackages="$pkgname-doc"
# There is a upstream-created tarball but it has depth=1 which unpacks
# everything into $srcdir instead of $srcdir/$pkgname-$pkgver
source="$pkgname-$pkgver.tar.gz::https://github.com/asciidoc/asciidoc-py3/archive/$pkgver.tar.gz"
builddir="$srcdir/asciidoc-py-$pkgver"

replaces="$pkgname-vim"

prepare() {
	default_prepare
	autoreconf -fi
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
444de69e3b87af984327873d5be1162157db5f7fb353e1fbbd24b4938ce0238fd474a67c9d3461fb7b069e7b029c63fbaf1ba8dd9cf7b91fbfa81e5429db404c  asciidoc-9.1.1.tar.gz
"
